/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.ove.openmath.mathematica;

/**
 *
 * @author Mr.Sam
 */
import java.io.File;

/**
* An interface to implement to be condidered as savable.
*/
public interface Savable {
    /**
    * Saves the instance.
    * @returns the result of the save action. Should be <CODE>null</CODE> if nothing
    * is expected after the save operation. The saved object otherwise.
    */
    public Object save();
    
    /**
    * Saves the instance into the specified file.
    * @returns the result of the save action. Should be <CODE>null</CODE> if nothing
    * is expected after the save operation. The saved object otherwise.
    */
    public Object save(File file);
    
    /**
    * Saves the instance with the specified name.
    * @param name the specified name.
    * @returns the result of the save action. Should be <CODE>null</CODE> if nothing
    * is expected after the save operation. The saved object otherwise.
    */
    public Object saveAs(String name);
    
    /**
    * Checks if the instance need to be saved.
    * @return <CODE>true</CODE> if the instance need to be saved. <CODE>false</CODE> otherwise.
    */
    public boolean isSaveNeeded();
    
    /**
    * Sets if the instance need to be saved.
    * @param needed <CODE>true</CODE> if the instance need to be saved. <CODE>false</CODE> otherwise.
    */
    public void setSaveNeeded(boolean needed);
}